/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.web.service;

import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.web.entity.WxAgents;
import com.jeeplus.modules.web.entity.WxCombination;
import com.jeeplus.modules.web.mapper.WxCombinationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 预购开机Service
 * @author rongjie
 * @version 2017-08-06
 */
@Service
@Transactional(readOnly = true)
public class WxCombinationService extends CrudService<WxCombinationMapper, WxCombination> {

	@Autowired
	private WxAgentsService wxAgentsService;

	public WxCombination get(String id) {
		return super.get(id);
	}

	public List<WxCombination> findList(WxCombination wxCombination) {
		return super.findList(wxCombination);
	}

	@Transactional(readOnly = false)
	public void save(WxCombination wxCombination) {
		super.save(wxCombination);
	}

	@Transactional(readOnly = false)
	public void delete(WxCombination wxCombination) {
		super.delete(wxCombination);
	}

	public List< WxCombination> findWxCombination(String agentsId,Integer type){
		return findWxCombination(agentsId,type,0);
	}
	public List< WxCombination> findWxCombination(String agentsId,Integer type,Integer deviceType){
		WxCombination  wxCombination=new  WxCombination();
		WxAgents wxAgents = new WxAgents();
		wxAgents.setId(agentsId);
		wxCombination.setAgents(wxAgents);
		wxCombination.setType(type);
		wxCombination.setDeviceType(deviceType);
		return super.findList( wxCombination);
	}

}
